package com.polaris.live.net.service

import com.polaris.live.common.network.ApiResponse
import com.polaris.live.resp.back_resp.ActSelfRanksVo
import com.polaris.live.resp.back_resp.CommunityTranslationResp
import com.polaris.live.resp.back_resp.GameGroupVoResp
import com.polaris.live.resp.back_resp.GameRankResp
import com.polaris.live.resp.back_resp.ListResultCommunityListResp
import com.polaris.live.resp.back_resp.WeekStarResp
import com.polaris.live.resp.base.ListResp
import com.polaris.live.resp.go_resp.DynamicTranslateRequest
import com.polaris.live.resp.go_resp.GameActiveBean
import com.polaris.live.resp.go_resp.IdRequest
import com.polaris.live.resp.go_resp.ReleaseDynamicRequest
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * GameService 游戏服务
 * @author Created by 天晴 on 2024/1/15 16:11
 * @since 1.0.0
 **/
interface GameService {

    /**
     * 获取游戏列表
     * 1 << 1: 直播
     * 1 << 2: 通话
     * 1 << 3: 我的
     * @see GameFromType
     */
    @GET("list")
    suspend fun getGameList(@Query("fromType") fromType: Long): ApiResponse<List<GameGroupVoResp>>

    /**
     * 游戏排行榜
     */
    @GET("list/rank")
    suspend fun getGameRank(): ApiResponse<List<GameRankResp>>

    /**
     * 用户游戏唤起
     */
    @POST("list/active")
    suspend fun getGameActive(@Body gameActiveBean: GameActiveBean): ApiResponse<Any>

    /**
     * 查询基础信息
     */
    @GET("weekly-star/rank")
    suspend fun getWeeklyStarRank(): ApiResponse<WeekStarResp>

    /**
     * 查询基础信息
     */
    @GET("weekly-star/ranks")
    suspend fun getWeeklyStarRanks(): ApiResponse<ActSelfRanksVo>

    /**
     * 查询社区列表
     */
    @GET("community/list")
    suspend fun getCommunityList(
        @Query("pageNumber") pageNumber: Int,
        @Query("pageSize") pageSize: Int,
    ): ApiResponse<ListResp<ListResultCommunityListResp>>

    /**
     * 点赞
     */
    @POST("community/like")
    suspend fun communityLike(@Body idRequest: IdRequest): ApiResponse<Any>

    /**
     * 发布动态
     */
    @POST("community/save")
    suspend fun releaseDynamic(@Body releaseDynamicRequest: ReleaseDynamicRequest): ApiResponse<Any>

    /**
     * 翻译
     */
    @POST("community/translate")
    suspend fun communityTranslate(@Body dynamicTranslateRequest: DynamicTranslateRequest): ApiResponse<CommunityTranslationResp>
}